<!DOCTYPE html>
<html lang="zh-CN">
<meta charset="utf-8" />
<head>
<title>市区媒体环境管理 <?php echo $this->config->item('title');?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet"	href="<?php echo base_url()?>public/css/bootstrap.min.css">
<link rel="stylesheet" href="<?php echo base_url()?>public/css/style.css">
	<script src="<?php echo base_url()?>public/js/jquery-2.0.2.min.js"></script>
	<script src="<?php echo base_url()?>public/js/bootstrap.min.js"></script>
	<script src="<?php echo base_url()?>public/js/bootstrap-confirm.js"></script>
	<script src='<?php echo base_url()?>public/js/ssi_common.js'></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#province").change(function(){
				$("#city").html('<option value="">请选择</option>');
				$("#region").html('<option value="">请选择</option>');

				var province =$("#province").val();
				if(!province){
					return false;
				}
				$.getJSON("<?php echo base_url()."index.php/sys_region_manage/get_regions"?>", { region_id: province }, function(json){
					if (json.length == 0) {
						return;
					}
					for(var i = 0, len = json.length; i<len; ++i){
						var region = json[i];
						$("#city").append("<option value=" + region.region_id + ">" + region.region_name + "</option>");
					}
				});
			});
			$("#city").change(function(){
				$("#region").html('<option value="">请选择</option>');

				var city =$("#city").val();
				$.getJSON("<?php echo base_url()."index.php/sys_region_manage/get_regions"?>", { region_id: city }, function(json){
					if (json.length == 0) {
						return;
					}
					for(var i = 0, len = json.length; i<len; ++i){
						var region = json[i];
						$("#region").append("<option value=" + region.region_id + ">" + region.region_name + "</option>");
					}
				});
			});
		});
	</script>
</head>
<body>
	
	<div role="navigation" class="navbar navbar-inverse navbar-fixed-top">
		<div class="container">
			<div class="navbar-header">
				<a class="navbar-brand">SSI后台管理系统</a>
			</div>
			<div class="collapse navbar-collapse navbar-right">
				<ul class="nav navbar-nav">
					<li><a href="<?php echo base_url()?>" class="navbar-link">首页</a></li>
					<li><a href="<?php echo base_url()."index.php/common_login_user_set"?>" class="navbar-link">超级管理员</a></li>
					<li><a href="<?php echo base_url()?>index.php/common_login_manage/logout" class="navbar-link">退出</a></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-xs-3">
				<?php echo $user_menu?>
			</div>
			<div class="col-sm-9">
				<ul class="nav nav-tabs">
					<li class="active"><a href="<?php echo base_url()."index.php/media_env_urban_manage"?>">商圈</a></li>
					<li><a href="<?php echo base_url()."index.php/media_env_urban_manage/env_urban_road"?>">主干道</a></li>
					<li><a href="<?php echo base_url()."index.php/media_env_urban_manage/env_urban_market"?>">专业市场</a></li>
					<li><a href="<?php echo base_url()."index.php/media_env_urban_manage/env_urban_station"?>">火车站</a></li>
					<li><a href="<?php echo base_url()."index.php/media_env_urban_manage/env_urban_stop"?>">汽车站</a></li>
					<li><a href="<?php echo base_url()."index.php/media_env_urban_manage/env_urban_venues"?>">大型场馆</a></li>
					<li><a href="<?php echo base_url()."index.php/media_env_urban_manage/env_urban_cbd"?>">CBD</a></li>
					<li><a href="<?php echo base_url()."index.php/media_env_urban_manage/env_urban_chief_district"?>">政务区</a></li>
					<li><a href="<?php echo base_url()."index.php/media_env_urban_manage/env_urban_industrial"?>">工业区</a></li>
				</ul>
				<br>
				<div class="panel panel-default">
					<div class="panel-body">
						<form action=""  method="get">
							<table width="100%" class="search_table">
								<tr>
									<td width="50%">
									所属区域:
									<select id ="province" name="province" class="form-control" >
									<option value="">请选择</option>
									<?php if ($province_list!=null) {	foreach ($province_list as $province){	?><option value="<?php echo $province['region_id']?>" <?php echo $province['region_id']==$search['province']?'selected="selected"':''?> ><?php echo $province['region_name']?></option>
									<?php 
										}
									}?>
									</select> 
									<select id ="city" name="city" class="form-control">
									<option value="">请选择</option>
									<?php if ($city_list!=null) {	foreach ($city_list as $city){	?><option value="<?php echo $city['region_id']?>" <?php echo $city['region_id']==$search['city']?'selected="selected"':''?> ><?php echo $city['region_name']?></option>
									<?php 
										}
									}?>
									</select> 
									<select id ="region" name="region" class="form-control">
									<option value="">请选择</option>
									<?php if ($region_list!=null) {	foreach ($region_list as $region){	?><option value="<?php echo $region['region_id']?>" <?php echo $region['region_id']==$search['region']?'selected="selected"':''?> ><?php echo $region['region_name']?></option>
									<?php 
										}
									}?>
									</select> 
									
									</td>
									<td>关键字: <input type="text" name="keyword" class="form-control full_td"  value="<?php echo $search['keyword']?>" /></td>
								</tr>
								<tr><td colspan="2" align="right"><input type="submit" class="btn btn-primary" value="搜索"></td></tr>
							</table>
						</form>
					</div>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading">
						<p>
						<?php if ($add_urban_env) {?>
							&nbsp;<a href="<?php echo base_url()."index.php/media_env_urban_manage/add_env_urban_circle"?>"
								class="btn btn-link pull-right"><span
								class="glyphicon glyphicon-plus"> </span><span> 添加商圈环境</span> </a>
						<?php }?>
						</p>
					</div>
					<div class="panel-body">
					<?php if ($query_urban_env) {?>
						<table class="table table-hover">
							<thead>
								<tr>
									<td class="col-md-1"><b>商圈名称</b></td>
									<td class="col-md-3"><b>商圈位置</b></td>
									<td class="col-md-1"><b>LED大牌</b></td>
									<td class="col-md-1"><b>常规大牌</b></td>
									<td class="col-md-2"><b>操作</b></td>
								</tr>
							</thead>
							<tbody>
							<?php if ($urban_circle_list!=null) {
									foreach ($urban_circle_list as $urban_circle){
								?>
								<tr>
									<td><?php echo $urban_circle['env_name']?></td>
									<td ><?php echo $urban_circle['province_name']?>
										<?php if ($urban_circle['city_name']!=""){echo "/".$urban_circle['city_name'];}?>
										<?php if ($urban_circle['region_name']!=""){echo "/".$urban_circle['region_name'];}?>
									</td>
									<td >
									<?php echo $urban_circle['led_billboard_num']?>
									</td>
									<td >
									<?php echo $urban_circle['common_billboard_num']?>
									</td>
									<td >
										<a title="查看" href="<?php echo base_url()."index.php/media_env_urban_manage/query_env_urban_circle?env_id=".$urban_circle['env_id']?>" class="btn btn-link"><span class="glyphicon glyphicon-eye-open"></span></a>
										<?php if ($assign_excellent_media) {?>
										<a title="分配" href="<?php echo base_url()."index.php/media_env_urban_manage/assgin_excellent_media?env_type=circle&env_id=".$urban_circle['env_id']?>" class="btn btn-link"><span class="glyphicon glyphicon-hand-right"></span></a>
										<?php }?>
										<?php if ($update_urban_env) {?>
										<a title="编辑" href="<?php echo base_url()."index.php/media_env_urban_manage/edit_env_urban_circle?env_id=".$urban_circle['env_id']?>" class="btn btn-link"><span class="glyphicon glyphicon-pencil"></span></a>
										<?php }?>
										<?php if ($delete_urban_env) {?>
										<a title="删除" rel="<?php echo base_url()."index.php/media_env_urban_manage/delete_env_urban_circle?env_id=".$urban_circle['env_id']?>" class="btn confirm btn-link"><span class="glyphicon glyphicon-trash"></span></a>
										<?php }?>
									</td>
								</tr>
								<?php }
								}?>
							</tbody>
						</table>
					<?php }?>
					</div>
				</div>
				<ul class="pagination pull-right">
				<?php echo $page_link?>
				</ul>
				
			</div>
		</div>
	</div>
	<script>$('.confirm[rel]').each(function() {
 $(this).confirm({
  'title' : '是否确认删除',
  'message' : '该操作无法恢复，请再次确认！',
  'action' : $(this).attr('rel')
 });
});</script>
	<div  class="back-to" id="toolBackTop">
	<a title="返回顶部" onclick="window.scrollTo(0,0);return false;" href="#top" class="back-top">
	返回顶部</a>
	<a title="返回底部" onclick="window.scrollTo(0,document.body.scrollHeight);return false;" href="#bottom" class="back-bottom">
	返回底部</a>
</div>
</body>
</html>
